home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 852 < prev    next >
Encoding:
Text File  |  1996-08-05  |  977 b   |  32 lines

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c,comp.os.os2.programmer.misc
  4. Subject: Re: redefining stdout and stderr
  5. Date: Tue, 09 Jan 96 15:48:28 GMT
  6. Organization: none
  7. Message-ID: <821202508snz@genesis.demon.co.uk>
  8. References: <DKw9Cv.2x4@fyi.net>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <DKw9Cv.2x4@fyi.net> fireresq@fyi.net  writes:
  15.  
  16. >I need to change the assocation of stdout and stderr programaticly.  I 
  17. >would be open for suggestions.
  18.  
  19. The standard C way of doing this is freopen() e.g.
  20.  
  21. #include <stdio.h>
  22.  
  23.     if (freopen(filename, "w", stdout) == NULL) {
  24.         /* Open failed */
  25.     }
  26.  
  27. -- 
  28. -----------------------------------------
  29. Lawrence Kirby | fred@genesis.demon.co.uk
  30. Wilts, England | 70734.126@compuserve.com
  31. -----------------------------------------
  32.